class_name PlayerState
extends Node

signal state_transition_requested(new_state:Player.State,state_data:PlayerStateData)

var ai_behavior : AIBehavior = null
var animation_player : AnimationPlayer = null
var ball:Ball = null
var ball_detection_area : Area2D =null
var player :Player = null
var state_data:PlayerStateData = null
var target_goal : Goal
var tackle_damage_emitter_area :Area2D = null
var teammate_detection_area :Area2D = null
var own_goal : Goal



func setup(context_player:Player,context_state_data:PlayerStateData,
	context_animation_player : AnimationPlayer,context_ball:Ball
	,context_teammate_detection_area :Area2D,context_ball_detection_area : Area2D
	, context_own_goal: Goal,context_target_goal : Goal,context_ai_behavior : AIBehavior
	,context_tackle_damage_emitter_area :Area2D )->void:
	
	player = context_player
	animation_player = context_animation_player
	state_data = context_state_data
	ball = context_ball
	teammate_detection_area = context_teammate_detection_area
	ball_detection_area = context_ball_detection_area
	target_goal = context_target_goal
	own_goal = context_own_goal
	ai_behavior = context_ai_behavior
	tackle_damage_emitter_area = context_tackle_damage_emitter_area

func transition_state(new_state:Player.State,context_state_data:PlayerStateData=PlayerStateData.new()):
	
	state_transition_requested.emit(new_state,context_state_data)



func on_animation_complete() -> void:
	pass


func can_carry_ball() -> bool:
	return false


func can_pass() -> bool:
	return false


func is_ready_for_kickoff() -> bool:
	return false
